#include<stdio.h>
#include<string.h>

void Delete_Space(char ch[]);
int main(void)
{
	int T;
	char ans[1024],input[1024],start[10],end[10];
	char right[1024]="START";
	
	scanf("%d",&T);
	getchar();
	
	for(int i=0;i<T;i++)
	{
		do
		{
			gets(start);
		}while(strcmp(right,start));
		gets(ans);
		gets(end);
		
		gets(start);
		gets(input);
		gets(end);
		
		if(!strcmp(input,ans))
		{
			printf("Accepted\n");
		}
		else
		{
			Delete_Space(ans);
			Delete_Space(input);
			if(!strcmp(input,ans))
			{
				printf("Presentation Error\n");
			}
			else
			{
				printf("Wrong Answer\n");
			}
		}
	}
	
	return 0;
}
void Delete_Space(char ch[])
{
	char temp[1024];
	int length=strlen(ch),time=0;
	
	for(int i=0;i<length;i++)
	{
		if(ch[i]!=' '&&ch[i]!='\n'&&ch[i]!='\t')
		{
			temp[time]=ch[i];
			time++;
		}
	}
	temp[time]='\0';
	
	strcpy(ch,temp);
}
